import java.util.Scanner;

class UserInput {
	private Scanner in = new Scanner(System.in);

	int getNumber(String prompt) {
        int result;
		System.out.println(prompt);
		while(!in.hasNextInt() && !in.hasNext("[1-9][0-9]*")) {
			in.nextLine();
			System.out.println("Incorrect format. Try again.");
		}
        result = in.nextInt();
        in.close();
        return result;
	}
}